package com.tengju.data.domain.model.activity;

import lombok.AllArgsConstructor;

/**
 * @author: 大木
 * @date: 2021/10/16 10:27 上午
 */
@AllArgsConstructor
public enum RoleTargetStarType {

    SEC(10, "SEC"),
    SERVICE_PROVIDER(20, "服务商"),
    DEALER(30, "经销商"),
    ;

    private final Integer val;
    private final String desc;

    public Integer getVal() {
        return val;
    }

    public String getDesc() {
        return desc;
    }

    public static RoleTargetStarType fromVal(Integer val) {
        for (RoleTargetStarType type : values()) {
            if (type.val.equals(val)) {
                return type;
            }
        }
        return null;
    }


    public static RoleTargetStarType fromName(String name) {
        for (RoleTargetStarType type : values()) {
            if (type.name().equals(name)) {
                return type;
            }
        }
        return null;
    }

}
